import logging
import time
import os
from parser import args
def getlogger(record_file:str):
    logger = logging.getLogger('main')
    logger.setLevel(logging.DEBUG)

    shandler = logging.StreamHandler()
    fhandler = logging.FileHandler(record_file)

    formatter = logging.Formatter(r'%(asctime)s--%(levelname)s--%(message)s')
    shandler.setFormatter(formatter)
    shandler.setLevel(logging.INFO)
    fhandler.setFormatter(formatter)
    fhandler.setLevel(logging.INFO)

    logger.addHandler(shandler)
    logger.addHandler(fhandler)
    return logger

def logger1():
    logger1 = getlogger(os.path.join(
        args.save_log, time.strftime('%Y%m%d%H%M%S') + '.log'))
    return logger1